package com.foreknow.controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class LoginController extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String path = req.getServletPath();  //     path =  "/LoginController/add"
        //类名
        String className = path.substring(1,path.lastIndexOf("/"));
        //方法名
        String methodName = path.substring(path.lastIndexOf("/")+1);
        PrintWriter out = resp.getWriter();
        out.println(className+"-----"+methodName);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

    }
}
